import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
export const router = [
  {
    path: '/',
    name: 'index',
    component: () => import('@/views/home/index'),
    meta: {
      keepAlive: false,
      title:'登陆'
    }
  },
  {
    path: '/legalPersonInfo',
    name: 'legalPersonInfo',
    component: () => import('@/views/legal/index'),
    meta: {
      keepAlive: false,
      title:'法人信息'
    },
    children:[
      {
        path: '/legalPersonInfoStepOne',
        name: 'legalPersonInfoStepOne',
        component: () => import('@/views/legal/legalPersonInfoStepOne'),
        meta: {
          keepAlive: false
        },
      },
      {
        path: '/legalPersonInfoStepTwo',
        name: 'legalPersonInfoStepTwo',
        component: () => import('@/views/legal/legalPersonInfoStepTwo'),
        meta: {
          keepAlive: false
        },
      },
      {
        path: '/legalPersonInfoStepThree',
        name: 'legalPersonInfoStepThree',
        component: () => import('@/views/legal/legalPersonInfoStepThree'),
        meta: {
          keepAlive: false
        },
      },
    ]
  },
  {
    path: '/sign',
    name: 'sign',
    component: () => import('@/views/sign/index'),
    meta: {
      keepAlive: false,
      title:'签署'
    },
    children:[
      {
        path: '/signStepOne',
        name: 'signStepOne',
        component: () => import('@/views/sign/signStepOne'),
        meta: {
          keepAlive: false
        },
      },
      {
        path: '/signStepTwo',
        name: 'signStepTwo',
        component: () => import('@/views/sign/signStepTwo'),
        meta: {
          keepAlive: false
        },
      },
      {
        path: '/signStepThree',
        name: 'signStepThree',
        component: () => import('@/views/sign/signStepThree'),
        meta: {
          keepAlive: false
        },
      },
      {
        path: '/signStepFour',
        name: 'signStepFour',
        component: () => import('@/views/sign/signStepFour'),
        meta: {
          keepAlive: false
        },
      },
    ]
  },
  {
    path: '/checkFace',
    name: 'checkFace',
    component: () => import('@/views/personalsign/checkFace'),
    meta: {
      keepAlive: false,
      title: '检测'
    }
  },
  {
    path: '/checkSuccess',
    name: 'checkSuccess',
    component: () => import('@/views/personalsign/checkSuccess'),
    meta: {
      keepAlive: false,
      title: '检测结果'
    }
  }
]

const createRouter = () =>
  new Router({
    // mode: 'history', // 如果你是 history模式 需要配置vue.config.js publicPath
    // base: '/app/',
    scrollBehavior: () => ({y: 0}),
    routes: router
  })

export default createRouter()
